<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/12/20/020
 * Time: 16:59
 */

namespace app\portal\controller;


use app\portal\model\VideoPostModel;
use cmf\controller\HomeBaseController;
use app\portal\model\PortalPostModel;

class DtController extends HomeBaseController
{
    //企业动态
    public function index()
    {
        //获取热门文章列表
        $where['recommended'] = ['=',1];
        $where['delete_time'] = ['=',0];
        $portalPostModel = new PortalPostModel();
        $articleHotList = $portalPostModel
            ->where($where)
            ->limit(3)
            ->order('create_time','DESC')
            ->select();
        //获取精彩视频
        $videoModel = new VideoPostModel();
        $videoHotList = $videoModel
            ->where($where)
            ->limit(3)
            ->order('create_time','DESC')
            ->select();
        $this->assign('articles',$articleHotList);
        $this->assign('videos',$videoHotList);
        return $this->fetch(':companyNews');

    }
}